From 4a9871d5bb71884b7a32e4b5eeae2642429827a3 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Fri, 12 Aug 2011 04:02:29 +0000 Subject: [PATCH] Add a thin shim around QDateTime to make it more compatible with our C-inspired usage for creation_time. --- gpsbabel/gbdatetime.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gpsbabel/gbdatetime.h diff --git a/gpsbabel/gbdatetime.h b/gpsbabel/gbdatetime.h new file mode 100644 index 000000000..6b56171bc --- /dev/null +++ b/gpsbabel/gbdatetime.h @@ -0,0 +1,18 @@ +// Copyright ME. + +#include + +// As this code began in C, we have several hundred places that set and +// read creation_time as a time_t. Provide some operator overloads to make +// that less painful. +class gbDateTime : public QDateTime { +public: + operator const time_t() const { + return this->toTime_t(); + } + const time_t& operator=(const time_t& t) { + this->setTime_t(t); + } +}; + + -- 2.30.2